<?php require_once 'C:\xampp\htdocs\GreenwichFreecycle\include\links.php'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb">

    <head>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
        <title>please enter your validation code</title>
    </head>

    <body>
        <?php
        require_once 'C:\xampp\htdocs\GreenwichFreecycle\validation\validations.php';
        require_once 'C:\xampp\htdocs\GreenwichFreecycle\include\utility.php';
        require_once 'C:\xampp\htdocs\GreenwichFreecycle\include\accountProcess.php';
// blimmin magic quotes should be off
        if (get_magic_quotes_gpc()) {
            $_POST = stripslashes_array($_POST);
        }
// copy POST input to scalars
        extract($_POST);

// the Yes button commits input to the database
// change below to correct button 
        if (isset($_POST['submitButton']) && isset($_POST['vCode'])) {
            if (validateVCode($vCode)) {
                $showOutcome = tryActivate($vCode);
            }
            else
            {$showOutcome = 'did not work';}
        }
        ?> 
        <div id="page">
            <h1>page to activate your account</h1>
            <h2>please enter your five digit code to activate your account</h2>
            <form action="" method="post" enctype="application/x-www-form-urlencoded">
                <fieldset>
                    <legend>validation code</legend>
                    <?php if(isset($_SERVER['HTTP_REFERER'])){
                    if (!($_SERVER['HTTP_REFERER'] == URLLIST)) {
                        echo '' .
                        '<label for="userName">please enter your username</label>' .
                        '<input type="text" name="userName" id="userName" maxlength="18" size="10"/> ' .
                        '<br/>';
                    }}
                    ?>    
                    <label for="vCode">please enter your 5 digit code</label>
                    <input type="text" name="vCode" id="vCode" maxlength="5" size="5"/>
                    <br/>
                    <label> <?php if(isset($showOutcome))echo "$showOutcome"; ?> <label/>
                        <br/>
                        <input type="submit" value="Submit" name="submitButton"/>
                </fieldset>
            </form>
        </div>
    </body

</html>
